package ngames.com.sushitv.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import ngames.com.sushitv.R;
import ngames.com.sushitv.entity.FanMadeVideo;

/**
 * Created by edmond on 16-8-9.
 */
public class FanMadeIntroVideoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
    private Context context;
    private List<FanMadeVideo> videoList;
    private LayoutInflater inflater;

    public FanMadeIntroVideoAdapter(Context context, List<FanMadeVideo> videoList){
        this.context = context;
        if(videoList.size()>12){
            this.videoList = videoList.subList(0,12);
        }else{
            this.videoList = videoList;
        }
        this.inflater = LayoutInflater.from(context);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.item_videorank_list,parent,false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return videoList.size();
    }

    class ViewHolder extends RecyclerView.ViewHolder{

        public ViewHolder(View itemView) {
            super(itemView);
        }
    }
}
